package com.ff.neuropp.domain;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

import com.ff.neuropp.Dto.PageDto;
import io.swagger.annotations.ApiModel;
import org.springframework.format.annotation.DateTimeFormat;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.ff.neuropp.util.DateSerializer;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@Data
@Entity
@Table(name = "t_coupon", uniqueConstraints = {@UniqueConstraint(columnNames="id")})
@ApiModel
/**
 * 折扣信息表
 * @author sun_weiwu
 *
 */
public class Coupon extends PageDto {

	 	private static final long serialVersionUID = 1L;

	 
	   	@Id
	    @GeneratedValue(strategy = GenerationType.IDENTITY)
	    private int id;
	 
	    @Column(name = "coupon_type", columnDefinition = "char(1) COMMENT '折扣类型'")
	    @ApiModelProperty(value = "折扣类型 1 直接折扣  2 折扣")
	    private Integer couponType;

	    @Column(name = "name", columnDefinition = "varchar(100) COMMENT '折扣名称'")
	    @ApiModelProperty(value = "折扣名称")
	    private String name;
	    
	    @Column(name = "discount", columnDefinition = "varchar(100) COMMENT '折扣'")
	    @ApiModelProperty(value = "折扣金额（打折数）")
	    private String discount;

		@Column(name = "status")
		@ApiModelProperty(value = "状态 1、线上 0、下线")
		private Integer status=1;

		//操作时间
	    @Column(updatable = false)
	    @org.hibernate.annotations.CreationTimestamp
	    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	    @JsonSerialize(using = DateSerializer.class)
	    private Date createDate;


	    @Column(name = "update_time", columnDefinition = "datetime COMMENT '更新时间'")
	    private Date updateTime;
	    
}
